extends "../daofeng-1/daofeng-1.gd"

func _extInit():
	._extInit()
	lv = 2
	addSkill("每炮击4次，瞬移到随机敌方单位身边，对周围(九宫格)的敌人发射鱼雷", "电光石火")

var normalAtkNum = 0
func _onNormalAtk(cha):
	._onNormalAtk(cha)
	normalAtkNum += 1
	if normalAtkNum >= p2:
		normalAtkNum = 0
		dianGuangSH()
var p4 = 1
var p2 = 4
func dianGuangSH():
	var chas = getAllChas(1)
	chas.shuffle()
	for cha in chas:
		if cha.isDeath || cha.isSumm:continue
		var mv = Vector2(cha.cell.x ,cha.cell.y)
		for i in config.aroundCells:
			var v = mv+i
			if matCha(v) == null && sys.main.isMatin(v) and setCell(v):
				var pos = sys.main.map.map_to_world(cell)
				ying(pos)
				position = pos
				aiCha = cha
				for j in getAroundChas(cell, false):
					castTorpedo(j)
				if lv == 4:
					#迅光雷袭
					azurHurtChara(cha, att.mgiAtk*5, sys.HurtType.WEAPON, sys.AtkType.SKILL, "迅光雷袭", false, p4)
					buff.addShengDun(self, 2)
				return